import os.path
import yaml


def write_yaml(data, yaml_path):
    with open(os.getcwd()+'\\yaml\\'+yaml_path, mode='a+', encoding='utf-8') as f:
        yaml.dump(data, stream=f, allow_unicode=True)


def read_yaml(yaml_path):
    with open(os.getcwd()+'\\yaml\\'+yaml_path, mode='r', encoding='utf-8') as f:
        value = yaml.load(stream=f, Loader=yaml.FullLoader)
        return value


def clear_yaml(yaml_path):
    with open(os.getcwd()+'\\yaml\\'+yaml_path, mode='w', encoding='utf-8') as f:
        f.truncate()


